package com.boliq.lol.ui.news;

import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.boliq.lol.R;
import com.boliq.lol.adapter.NewsArticleAdapter;
import com.boliq.lol.base.BaseFragment;
import com.boliq.lol.bean.NewsArticleBean;

/**
 * <pre>
 * ================================================
 * 作者: BLQ_SSNB
 * 日期：2021/2/20
 * 邮箱: blq_ssnb@outlook.com
 * 修改次数: 1
 * 描述:
 *      添加描述
 * ================================================
 * </pre>
 */
public class NewsArticleFragment extends BaseFragment {

    private RecyclerView mRecyclerView;
    private NewsArticleAdapter mAdapter;

    @Override
    protected int rootLayout() {
        return R.layout.fragment_news_article;
    }

    @Override
    protected void initView(View view) {
        mRecyclerView = view.findViewById(R.id.rv_content_list);
    }

    @Override
    protected void initData() {
        NewsArticleBean na1=new NewsArticleBean("11.4&11.5云顶之弈更新：天选系统小型调整",R.drawable.na1,"LoL","游戏日报","50.4万次");
        NewsArticleBean na2=new NewsArticleBean("盟物堂：国外大神完美比例还原超炫酷沙皇",R.drawable.na2,"LoL","英雄联盟盟物堂","323次");
        NewsArticleBean na3=new NewsArticleBean("3月5日18点不停机更新公告",R.drawable.na3,"LoL","英雄联盟官方 ","49.3万次");
        NewsArticleBean na4=new NewsArticleBean("弈招致胜：云顶速成大师诀窍之站位篇",R.drawable.na4,"LoL","北派攻略","5.1万次");
        NewsArticleBean na5=new NewsArticleBean("恭喜EDG达成LPL一万杀成就！",R.drawable.na5,"LoL","英雄联盟赛事官方","2539次");
        NewsArticleBean na6=new NewsArticleBean("Puff对阵JKL！忍界大战 TES欲复仇IG！",R.drawable.na6,"LoL","落夜电竞","734次");
        NewsArticleBean na7=new NewsArticleBean("狮子汪亲笔：暗行者暴击狮子保姆教学！搭配时光最强上分套路！！",R.drawable.na7,"LoL","掌盟大神团","37.3万次");
        NewsArticleBean na8=new NewsArticleBean("云顶之弈命运之轮季中更新：欢迎来到瑞兽闹新春",R.drawable.na8,"LoL","英雄联盟官方","39.8万次");
        mAdapter = new NewsArticleAdapter();
        mAdapter.addData(na1);
        mAdapter.addData(na2);
        mAdapter.addData(na3);
        mAdapter.addData(na4);
        mAdapter.addData(na5);
        mAdapter.addData(na6);
        mAdapter.addData(na7);
        mAdapter.addData(na8);
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());
//        mAdapter.addData(new NewsArticleBean());

    }

    @Override
    protected void bindData() {
        super.bindData();
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mRecyclerView.setAdapter(mAdapter);

    }

    @Override
    protected void bindEvent() {

    }
}
